//
//  ShareTool.m
//  BSBDJ
//
//  Created by user on 16/5/28.
//  Copyright © 2016年 Burning. All rights reserved.
//

#import "ShareTool.h"
#import "UMSocial.h"
#import "UMSocialData.h"
#import "UMSocialSnsService.h"
#import "TZEssenceItem.h"
@interface ShareTool()<UMSocialUIDelegate>

@end

@implementation ShareTool

static ShareTool *_instance;

+ (instancetype)shareManager{

    return [[self alloc] init];
}

+ (instancetype)allocWithZone:(struct _NSZone *)zone{
    
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken,^{
    
        _instance = [self allocWithZone:zone];
    });
    
    return _instance;
}

- (void)share:(TZEssenceItem *)item vc:(UIViewController* )vc{
    [UMSocialData defaultData].extConfig.title = @"分享百思不得姐";
    [UMSocialData defaultData].extConfig.qqData.url = item.weixin_url;
    [UMSocialSnsService presentSnsIconSheetView:vc
                                         appKey:@"5746fa3667e58e1914002df5"
                                      shareText:[NSString stringWithFormat:@"%@,%@",item.text,item.weixin_url]
                                     shareImage:item.large_image
                                shareToSnsNames:nil
                                       delegate:nil];
}


@end
